How to save data frame changes to a txt file